package com.leyou.trade.task;


import com.leyou.trade.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class IntervalClearOrder {

    @Autowired
    private OrderService orderService;


    final long refreshTime = 300000;

    //周期执行任务5分钟一次
    @Scheduled(fixedDelay = refreshTime)
    public void clearOrderInTime() {
        orderService.clearOrder();
    }


}
